package com.dtwave.wechat.service.provider.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dtwave.wechat.service.api.dto.req.ReqUserDto;
import com.dtwave.wechat.service.provider.database.dao.UserMapper;
import com.dtwave.wechat.service.provider.database.entity.UserEntity;
import com.dtwave.wechat.service.provider.dto.UserDto;
import com.dtwave.wechat.service.provider.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: liuwenxiang
 * @Date: 2018/12/17 19:57
 * @Description:
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> implements UserService {

     @Autowired
     private UserMapper userMapper;

    @Override
    public List<UserEntity> selectListByPage(ReqUserDto req){
        return userMapper.selectListByPage(req);
    }

    @Override
    public long selectAmount(ReqUserDto req){
        return userMapper.selectAmount(req);
    }

    @Override
    public UserDto selectByPhone(String phone){
        return userMapper.selectByPhone(phone);
    }

    @Override
    public int delUserOfficeRelation(){
        return userMapper.delUserOfficeRelation();
    }

    @Override
    public int addUserOfficeRelation(String userId,Integer officeId){
        return userMapper.addUserOfficeRelation(userId,officeId);
    }
}
